package com.xd.clap.controller;

import com.xd.clap.entity.User;
import com.xd.clap.entity.response.Result;
import com.xd.clap.services.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService us;

    /**
     *获取用户信息
     */
    @PostMapping("/getUser")
    public Result getUser(@RequestBody User user) {
        return us.getUser(user.getPhone());
    }

    /**
     *修改用户信息
     */
    @PostMapping("/updateUser")
    public Result updateUser(@RequestBody User user) {
        return us.updateUser(user);
    }



}
